package com.example.test9_1;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.Nullable;

public class RegisterActivity extends Activity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);
        Intent intent = getIntent();//获取Intent对象
        Bundle bundle = intent.getExtras();//获取传递的数据包
        TextView user = (TextView) findViewById(R.id.userName);//获取显示用户名的TextView
        user.setText("用户名："+bundle.getString("user"));
        TextView pwd = (TextView) findViewById(R.id.pwd);//获取显示用户名的TextView
        pwd.setText("密码："+bundle.getString("pwd"));
        TextView email = (TextView) findViewById(R.id.email);//获取显示用户名的TextView
        email.setText("邮箱："+bundle.getString("email"));

        Button button = (Button) findViewById(R.id.back);//获取 返回上一步 按钮
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                setResult(0x717,intent);//设置返回的结果吗，并返回调用该Activity的Activity
                finish();//关闭当前的Activity
            }
        });

    }
}
